package com.sgb.knowledgeshare.view.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;
import com.sgb.knowledgeshare.BR;
import com.sgb.knowledgeshare.R;
import com.sgb.knowledgeshare.entity.ShareDictEntity3;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;
import java.util.List;

/**
 * Created by：PC0033 on 2020/9/27 15:08
 */
public class VideoReportAdaoter extends BaseRecycleAdapter<ShareDictEntity3> {

    public VideoReportAdaoter(Context context, List<ShareDictEntity3> datas) {
        super(context, R.layout.item_share_video_report, datas);
    }
    @Override
    public void convert(ItemViewHolder holder, ShareDictEntity3 entity) {
        holder.setBinding(BR.viewModel, entity);
        TextView reporttypenames = holder.itemView.findViewById(R.id.report_type_name);
        ImageView reporttypeimage = holder.itemView.findViewById(R.id.report_type_image);
        reporttypenames.setText(entity.getName()+"");
        if (entity.isHaveSpec() == true){
            reporttypeimage.setImageResource(R.mipmap.video_report_select);
        }else {
            reporttypeimage.setImageResource(R.mipmap.video_report_no);
        }
    }
}
